
<#-- *************** Text Display Convenience *************** -->
<#-- Hash Bracket Macro -->
<#-- used when JSF wants a "#{" -->
<#macro hb>${r"#{"}<#nested>${r"}"}</#macro>  

<#-- *************** Entity Display *************** -->
<#-- used for Entity Cap First-->
<#macro boCap>${bo.entityName?cap_first}</#macro>

<#-- used for Entity LowerCase-->
<#macro boLow>${bo.entityName?uncap_first}</#macro>

<#-- used for Entity ALLCAP-->
<#macro boAll>${bo.entityName?upper_case}</#macro>

<#-- used for Entity Display Name-->
<#macro boDisplay>${bo.displayName}</#macro>

<#-- PLURAL Parent Entity Cap First-->
<#macro boDisplayPlural><#assign some = util.pluralize(bo.displayName)>${some}</#macro>


<#-- *************** Child Display *************** -->
<#-- used for Child Entity Cap First-->
<#macro childCap>${child.entityName?cap_first}</#macro>

<#-- used for Child Entity Display-->
<#macro childDisplay>${child.displayName}</#macro>

<#-- used for Child Entity LowerCase-->
<#macro childLow>${child.entityName?uncap_first}</#macro>

<#-- used for Child Entity ALLCAP-->
<#macro childAll>${child.entityName?upper_case}</#macro>

<#-- PLURAL Child Entity Cap First-->
<#macro childCapPlural><#assign some = util.pluralize(child.entityName)>${some?cap_first}</#macro>

<#-- PLURAL Child Display-->
<#macro childDisplayPlural><#assign some = util.pluralize(child.displayName)>${some}</#macro>

<#-- PLURAL for Child Entity LowerCase-->
<#macro childLowPlural><#assign some = util.pluralize(child.entityName)>${some?uncap_first}</#macro>

<#-- PLURAL for Child Entity ALLCAP-->
<#macro childAllPlural><#assign some = util.pluralize(child.entityName)>${some?upper_case}</#macro>


<#-- *************** Parent Display *************** -->
<#-- used for Parent LowerCase-->
<#macro parentLow>${parent.entityName?uncap_first}</#macro>

<#-- used for Parent CapFirst-->
<#macro parentCap>${parent.entityName?cap_first}</#macro>

<#-- used for Parent ALLCAP-->
<#macro parentAll>${parent.entityName?upper_case}</#macro>

<#-- PLURAL Parent Entity Cap First-->
<#macro parentCapPlural><#assign some = util.pluralize(parent.entityName)>${some?cap_first}</#macro>

<#-- PLURAL Parent Display-->
<#macro parentDisplayPlural><#assign some = util.pluralize(parent.displayName)>${some}</#macro>

<#-- PLURAL for Parent Entity LowerCase-->
<#macro parentLowPlural><#assign some = util.pluralize(parent.entityName)>${some?uncap_first}</#macro>

<#-- PLURAL for Parent Entity ALLCAP-->
<#macro parentAllPlural><#assign some = util.pluralize(parent.entityName)>${some?upper_case}</#macro>


<#-- *************** Member Display *************** -->
<#-- used for Member Cap First-->
<#macro meCap>${member.memberName?cap_first}</#macro>

<#-- used for Member LowerCase-->
<#macro meLow>${member.memberName?uncap_first}</#macro>

<#-- used for Member ALLCAP-->
<#macro meAll>${member.memberName?upper_case}</#macro>

<#-- used for Member Required output to String-->
<#macro meIsRequired>${member.required?string}</#macro>

<#-- used for Member Return type-->
<#macro meType>${member.returnType}</#macro>

<#-- used for Alias Member target Capfirst -->
<#macro meTargetCap>${member.target?cap_first}</#macro>

<#-- used for CustomString Member customString -->
<#macro meCustomString>${member.customString}</#macro>

<#-- used for Member Display Name-->
<#macro meDisplay>${member.displayName}</#macro>

<#-- *************** Member Display *************** -->
<#macro isFilterable member>
	<#if 
		!member.returnType?ends_with("Address")
		&&
		!member.returnType?ends_with("Document") 		
	>
	<#nested>
	</#if>
</#macro>

<#-- Only returns the nested content if the member is not a 'detailOnly' member. -->
<#macro isSummaryField member>
	<#if !member.detailOnly>
	<#nested>
	</#if>
</#macro>

<#--
Purpose: Only returns the nested content if the member is not a 'summaryOnly' member.
Params: A member to analyze
Author: Erik Gustavson
Date: October 14th, 2005
-->
<#macro isDetailField member>
	<#if !member.summaryOnly>
	<#nested>
	</#if>
</#macro>

<#-- **** Relationship Filters **** -->
<#macro isInternalized relation>
	<#if relation.internalized>
	<#nested>
	</#if>
</#macro>

<#macro isNotInverse relation>
	<#if !relation.inverse>
	<#nested>
	</#if>
</#macro>

<#-- Uses ModelUtil.isLocal to determine if the relationship/member is local
to the passed-in entity or is inherited -->
<#macro isNotInherited entity, inheritable>
	<#if util.isLocal(entity, inheritable)>
<#nested>
	</#if>
</#macro>

<#-- Uses ModelUtil.isLocal to determine if the relationship/member is local
to the passed-in entity or is inherited -->
<#macro isNotAbstract entity>
	<#if !entity.isAbstract()>
<#nested>
	</#if>
</#macro>

<#-- Uses ModelUtil.isLocal to determine if the relationship/member is local
to the passed-in entity or is inherited -->
<#macro isAbstract entity>
	<#if entity.isAbstract()>
<#nested>
	</#if>
</#macro>

<#-- Determines if the passed in member is visible - some members, like DisplayName, are
not visible and thus need to be filtered out -->
<#macro isVisible member>
<#if !member.hidden>
	<#nested>
</#if>
</#macro>

<#-- Determines if the passed in member is NOT read-only - most members are this by default -->
<#macro isNotReadOnly member>
<#if !member.readOnly>
	<#nested>
</#if>
</#macro>

<#-- Determines if the passed in member IS read-only - some members cannot be edited -->
<#macro isReadOnly member>
<#if member.readOnly>
	<#nested>
</#if>
</#macro>

<#-- **** Relationship Helpers **** -->
<#macro internalized>
	<#if relation.internalized>
	true
	<#else>
	false
	</#if>
</#macro>

<#-- **** Extension Filters *** -->
<#macro extends entity><#if entity.isExtendingEntity()>${bo.extendsReference}<#else>AbstractHibernateEntity</#if></#macro>

<#-- **** Interface Filters *** -->
<#macro interface entity><#assign count = 0><#if entity.hasInterfaces()>implements <#list entity.interfaces as interface><#if (count > 0) >, </#if>${interface.entityName}<#assign count = count + 1></#list></#if></#macro>

<#-- Pluralize any incoming strings -->
<#macro pluralize myString><#assign out = util.pluralize(myString)>${out}</#macro>

<#-- used for Validator  ID-->
<#macro valid>${validator.toImplString()}</#macro>

<#-- default Concrete member value macro -->
<#macro defaultMember member>
${member.defaultValue?default("null")};
</#macro>